import dayjs from "dayjs";

export const log = (...args) => {
  const time = dayjs().format("YYYY-MM-DD HH:mm:ss");
  console.log(`[${time}]`, ...args);
};

export const logError = (...args) => {
  const time = dayjs().format("YYYY-MM-DD HH:mm:ss");
  console.error(`[${time}]`, ...args);
};

export const sleep = (time) =>
  new Promise((resolve) => setTimeout(resolve, time));
